chore: Restructure some more grpc services.#5260
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
## Context What was the situation or problem before this change? ## Change Summary What changes were made? ## Rationale Why was this approach taken? ## Impact What parts of the system or workflows are affected? --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
## Context What was the situation or problem before this change? ## Change Summary What changes were made? ## Rationale Why was this approach taken? ## Impact What parts of the system or workflows are affected? --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
## Context What was the situation or problem before this change? ## Change Summary What changes were made? ## Rationale Why was this approach taken? ## Impact What parts of the system or workflows are affected? --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
## Context What was the situation or problem before this change? ## Change Summary What changes were made? ## Rationale Why was this approach taken? ## Impact What parts of the system or workflows are affected? --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
prmukherj
marked this pull request as ready for review
July 17, 2026 08:37
prmukherj
requested review from
Copilot,
hpohekar,
mayankansys,
mkundu1 and
seanpearsonuk
July 17, 2026 08:37
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the Fluent gRPC service integration by separating low-level gRPC stub wrappers (_grpc_services) from higher-level Python service wrappers (services), and routing construction/version-selection through a factory layer.
Changes:
- Introduces high-level wrapper classes for events, transcript, monitors, text interface, and solution variables, created via
ServiceFactory. - Adds/expands
_grpc_servicesmodules for the corresponding raw gRPC stub implementations (v0/v1), and removes older v1-specific service modules. - Updates session wiring and tests/docs to use the new service entry points (e.g.,
services.text_interface, removal ofsvar_*deprecated accessors).
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_tui_api.py | Updates TUIMenu import to new services.text_interface module. |
| tests/test_solution_variables.py | Removes assertions relying on deprecated solver.svar_* accessors. |
| tests/test_settings_api.py | Removes a version-specific comment from the test. |
| tests/test_session.py | Adjusts deprecation-related expectations for dir() and deprecated attributes. |
| tests/test_codegen.py | Updates codegen expected import path for TUI classes. |
| src/ansys/fluent/core/streaming_services/events_streaming.py | Routes pause/resume/unregister operations via injected events service object. |
| src/ansys/fluent/core/session.py | Switches session service construction to use fluent_connection._service_factory. |
| src/ansys/fluent/core/session_solver.py | Uses ServiceFactory for solution-variable and monitor services; removes deprecated svar_* properties. |
| src/ansys/fluent/core/session_shared.py | Updates TUIMenu import path to services.text_interface. |
| src/ansys/fluent/core/services/transcript.py | Replaces gRPC-stub implementation with a high-level wrapper delegating to a provided service. |
| src/ansys/fluent/core/services/text_interface.py | Introduces TextInterface wrapper delegating to a service implementing the abstract interface; updates PyMenu to call new helpers. |
| src/ansys/fluent/core/services/solution_variables.py | Refactors solution variables to depend on abstract interfaces and delegate gRPC-specific details to services. |
| src/ansys/fluent/core/services/solution_variables_v1.py | Removes legacy v1-specific solution variables implementation module. |
| src/ansys/fluent/core/services/object_model.py | Updates module docstring to reflect high-level wrapper role. |
| src/ansys/fluent/core/services/monitors.py | Adds high-level Monitor wrapper delegating to a provided service. |
| src/ansys/fluent/core/services/events.py | Adds high-level Events wrappers (and version-specific variants) delegating to underlying services. |
| src/ansys/fluent/core/services/datamodel_tui_v1.py | Removes legacy v1-specific TUI module. |
| src/ansys/fluent/core/services/batch_ops.py | Refactors BatchOps to delegate op metadata/execute to the underlying service instead of local proto introspection/parsing. |
| src/ansys/fluent/core/services/application_runtime.py | Adjusts solution-event handling logic for registering pause callbacks. |
| src/ansys/fluent/core/services/api_upgrade.py | Updates advisor to use FluentVersion and adds scheme-based journal support for older versions. |
| src/ansys/fluent/core/services/abstract_text_interface.py | Adds abstract interface for text interface services. |
| src/ansys/fluent/core/services/abstract_solution_variables.py | Adds abstract interfaces for solution variable info/data and returned data container. |
| src/ansys/fluent/core/services/abstract_monitors.py | Replaces prior content with an abstract monitor interface. |
| src/ansys/fluent/core/services/abstract_field_data.py | Fixes module docstring to reflect field-data abstraction. |
| src/ansys/fluent/core/services/abstract_events.py | Adds abstract interface for events services. |
| src/ansys/fluent/core/services/init.py | Introduces high-level ServiceFactory mapping Fluent versions to appropriate service wrappers. |
| src/ansys/fluent/core/data_model_cache.py | Broadens exception handling when loading generated code (ImportError/FileNotFoundError). |
| src/ansys/fluent/core/codegen/tuigen.py | Updates generated import strings to use services.text_interface. |
| src/ansys/fluent/core/_grpc_services/transcript_service.py | Adds v1 transcript gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/transcript_service_v0.py | Adds v0 transcript gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/text_interface_service.py | Adds v1 text interface gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/text_interface_service_v0.py | Adds v0 text interface gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/solution_variable_service.py | Adds v1 solution variable gRPC stub wrapper and associated parsing/helpers. |
| src/ansys/fluent/core/_grpc_services/solution_variable_service_v0.py | Adds v0 solution variable gRPC stub wrapper and associated parsing/helpers. |
| src/ansys/fluent/core/_grpc_services/monitor_service.py | Refactors/implements v1 monitor gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/monitor_service_v0.py | Refactors/implements v0 monitor gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/events_service.py | Refactors/implements v1 events gRPC stub wrapper with pause/resume registration. |
| src/ansys/fluent/core/_grpc_services/events_service_v0.py | Adds v0 events gRPC stub wrapper. |
| src/ansys/fluent/core/_grpc_services/batch_ops_service_v0.py | Adds v0 batch ops gRPC stub wrapper with op-metadata discovery and response parsing. |
| src/ansys/fluent/core/_grpc_services/init.py | Extends GRPCServiceFactory to expose new stubs (events, transcript, text_interface, monitor, solution_variable, batch_ops). |
| doc/source/user_guide/legacy/tui.rst | Updates documented TUIMenu base class import path. |
| doc/changelog.d/5265.maintenance.md | Adds maintenance changelog entry for solution variables. |
| doc/changelog.d/5264.maintenance.md | Adds maintenance changelog entry for monitors. |
| doc/changelog.d/5262.maintenance.md | Adds maintenance changelog entry for Batch Ops refactor. |
| doc/changelog.d/5260.maintenance.md | Adds maintenance changelog entry for grpc service restructure. |
| doc/api_rstgen.py | Updates API docs generation list to use text_interface instead of datamodel_tui. |
Comments suppressed due to low confidence (1)
src/ansys/fluent/core/services/abstract_monitors.py:30
- AbstractMonitor docstring says "health check", which is unrelated to monitors and can confuse users of the abstraction.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mkundu1
approved these changes
Jul 17, 2026
mayankansys
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The grpc service layer and python implementation layers were closely couple together for the grpc services.
Change Summary
Cleanly segregate the grpc service layer and python implementation layer for 5 grpc services.
Implemented a factory layer which takes care of version checking logic, etc.
Impact
Users to see a cleaner and well documented interface.
_grpc_services
services
_grpc_serviceshandles all version checking, etc.From FluentConnection or session layer: